package com.starblink.login.privacysettings.ui

import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.starblink.android.basic.base.activity.BaseTVMActivity
import com.starblink.android.basic.config.PrivacyConfig
import com.starblink.android.basic.ext.click
import com.starblink.android.basic.extension.navigationTo
import com.starblink.android.basic.network.base.BaseApiClient
import com.starblink.basic.route.RoutePage
import com.starblink.basic.style.title.OnTitleBarListener
import com.starblink.basic.style.title.TitleBar
import com.starblink.basic.util.CommUtils
import com.starblink.login.databinding.ActivityPrivacySettingsBinding


/**
 * privacy_settings_route.dart
 */
@Route(path = RoutePage.Login.PRIVACY_SETTINGS)
class PrivacySettingsActivity :
    BaseTVMActivity<ActivityPrivacySettingsBinding, PrivacySettingsVM>() {

    override fun initViewBinding(): ActivityPrivacySettingsBinding =
        ActivityPrivacySettingsBinding.inflate(layoutInflater)

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        //返回按钮
        viewBinding.titleBar.setOnTitleBarListener(object : OnTitleBarListener {
            override fun onLeftClick(titleBar: TitleBar?) {
                finish()
            }
        })

        viewBinding.lpService1.fdBtnText.text =
            CommUtils.getString(com.starblink.basic.style.R.string.privacy)
        viewBinding.lpService2.fdBtnText.text =
            CommUtils.getString(com.starblink.basic.style.R.string.services)

        viewBinding.lpService1.fdBtn.click {
            navigationTo(url =BaseApiClient.getPrivacyUrl())
        }
        viewBinding.lpService2.fdBtn.click {
            navigationTo(url = BaseApiClient.getTermsUrl())
        }
    }
}